import _ from 'lodash'
import { computed, ref } from 'vue'

/**
 * 返厂清单列表数据共享
 */
const _repairGoodList = ref<Array<ReturnFactoryDetailGood>>([])
export default function () {
  const repairGoodList = computed(() => _.cloneDeep(_repairGoodList.value))

  const setRepairGoodList = (data: Array<ReturnFactoryDetailGood>) => {
    _repairGoodList.value = _.cloneDeep(data)
  }

  const clearRepairGoodList = () => {
    _repairGoodList.value.length = 0
  }

  return {
    repairGoodList,
    setRepairGoodList,
    clearRepairGoodList,
  }
}
